package classtest;

import java.util.Scanner;

public class Test2 {
    //字符串反转
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //创建对象
        StringBuffer sb = new StringBuffer();
        System.out.println("请输入字符串：");
        sb.append(sc.next());
        System.out.println("原字符串为："+sb);
        System.out.println("反转后的字符串为："+sb.reverse());
    }
}
